﻿@using Models;
@{
    ViewBag.Title = "Charts";
}
<center>
@(Html.Telerik().Chart<StockView>().Name("StockViewPieChart").Title("仓储情况")
                                       .Legend(legend => legend
                                       .Position(ChartLegendPosition.Bottom)).Series(series =>
                                       {
                                           series.Pie("Percentage", "StockName")
                                               .Labels(labels => labels.Visible(true).Template("<#= value #>%")
                                               .Align(ChartPieLabelsAlign.Circle)
                                               .Position(ChartPieLabelsPosition.Center))
                                               .StartAngle(180).Padding(0);
                                       })
                                       .DataBinding(dataBinding => dataBinding.Ajax().Select("AjaxStockPieChart", "Warehouse",new {id = (int)ViewBag.WarehouseID}))
                                       .Tooltip(tooltip => tooltip.Visible(true).Template("<#= value #>%"))
                                       .HtmlAttributes(new { style = "width: 400px; height: 300px;" })
)
@(Html.Telerik().Chart<StockView>().Name("StockViewBarChart").Title("仓储情况")
                                       .Legend(legend => legend.Position(ChartLegendPosition.Bottom)).Series(series =>
                                       {
                                           series.Bar("Volume").Name("库存数量").Labels(labels => labels.Position(ChartBarLabelsPosition.InsideEnd).Visible(true));
                                           series.Bar(s => s.CategoryTotal).Name("总库存数量").Labels(labels => labels.Position(ChartBarLabelsPosition.InsideEnd).Visible(true));
                                       })
                                               .CategoryAxis(axis => axis.Categories(s => s.QualityName))
                                               .DataBinding(dataBinding => dataBinding.Ajax().Select("AjaxStockBarChart", "Warehouse",new {id = (int)ViewBag.WarehouseID}))
                                       .HtmlAttributes(new { style = "width: 670px; height: 500px;" })) 
</center>
<div>
    @Html.ActionLink("回到列表", "Index")
</div>